#ifndef _ALARM_TASK_H
#define _ALARM_TASK_H

#define ALARM_ON        1
#define ALARM_OFF       0

#define ALARM_REPEAT    1
#define ALARM_NONREPEAT 0

typedef struct{
	char alarm_id;
	char mac[32];//mac地址
	char status;//控制状态
	char alarm_time[8];
	char alarm_switch;//开关
	char alarm_repeat;//是否重复
	int (*alarm_cb) (const char *, const unsigned char);
}alarm_info_t;

typedef struct alarm_task{
	alarm_info_t  alarm_info;
	struct alarm_task *next;
}alarm_task_node_t;

typedef struct{
	alarm_task_node_t *head;
	alarm_task_node_t *tail;
}alarm_task_head_t;


alarm_task_head_t *alarm_task_creat_head(void);
void insert_alarm_task(alarm_task_head_t *alarm_head, alarm_info_t *info);
void loop_alarm_task(alarm_task_head_t *alarm_head);
void free_alarm_task(alarm_task_head_t *alarm_head);


#endif